label: _("Homepage"),
tooltip_text: _("Visit extension homepage"),
no_show_all: true,
- visible: row.url != null,
+ visible: row.url !== '',
});
toolbar.add(urlButton);
InternalChildren: [
'nameLabel',
'descriptionLabel',
+ 'versionLabel',
+ 'authorLabel',
'revealButton',
'revealer',
],
action.connect('activate', () => this.get_toplevel().openPrefs(this.uuid));
this._actionGroup.add_action(action);
+ action = new Gio.SimpleAction({
+ name: 'show-url',
+ enabled: this.url !== '',
+ });
+ action.connect('activate', () => {
+ Gio.AppInfo.launch_default_for_uri(
+ this.url, this.get_display().get_app_launch_context());
+ });
+ this._actionGroup.add_action(action);
+
action = new Gio.SimpleAction({
name: 'enabled',
state: new GLib.Variant('b', false),
return this._extension.hasPrefs;
}
+ get creator() {
+ return this._extension.metadata.creator || '';
+ }
+
get url() {
- return this._extension.metadata.url;
+ return this._extension.metadata.url || '';
+ }
+
+ get version() {
+ return this._extension.metadata.version || '';
}
_updateState() {
let action = this._actionGroup.lookup('enabled');
action.set_state(new GLib.Variant('b', state));
action.enabled = this._canToggle();
+
+ this._versionLabel.label = `${this.version}`;
+ this._versionLabel.visible = this.version !== '';
+
+ this._authorLabel.label = `${this.creator}`;
+ this._authorLabel.visible = this.creator !== '';
}
_onDestroy() {
<property name="yalign">0</property>
</object>
</child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible"
+ bind-source="versionLabel"
+ bind-property="visible"
+ bind-flags="sync-create"/>
+ <property name="no_show_all">True</property>
+ <property name="label" translatable="yes">Version</property>
+ <property name="xalign">0</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="versionLabel">
+ <property name="no_show_all">True</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible"
+ bind-source="authorLabel"
+ bind-property="visible"
+ bind-flags="sync-create"/>
+ <property name="no_show_all">True</property>
+ <property name="label" translatable="yes">Author</property>
+ <property name="xalign">0</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="authorLabel">
+ <property name="no_show_all">True</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Website</property>
+ <property name="action_name">row.show-url</property>
+ <property name="valign">end</property>
+ <property name="margin-top">12</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ </packing>
+ </child>
</object>
</child>
</object>